package com.sinoglobal.ningxia.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.sinoglobal.ningxia.R;
import com.sinoglobal.ningxia.fragment.ProgramCommentFragment;
import com.sinoglobal.ningxia.fragment.ProgramHistoryFragment;

/**
 * @author qiwx
 * @createdate 2014-6-26 下午1:52:52
 * @Description: 栏目详情
 */
public class ProgramInfoFragmentAdapter extends FragmentPagerAdapter {

	public final static int TAB_COUNT = 2;
	private ProgramHistoryFragment historyFragment;
	private ProgramCommentFragment commentFragment;

	public ProgramInfoFragmentAdapter(FragmentManager fm,Context context,String programId) {
		super(fm);
		historyFragment =ProgramHistoryFragment.getIntance(context,programId);
		commentFragment =ProgramCommentFragment.getIntance(context,programId);
	}

	@Override
	public Fragment getItem(int id) {
		//Auto-generated method stub
		switch (id) {
		case 0:
			return historyFragment;

		case 1:
			return commentFragment;

		}	
	   return null;	
	}

	@Override
	public int getCount() {
		//Auto-generated method stub
		return TAB_COUNT;
	}

}
